package com.wyx.suanfa;

/**
 * @author 王艺锡
 * @version 1.0
 */
public class removeNthFromEnd {
    //给你一个链表，删除链表的倒数第 n 个结点，并且返回链表的头结点。
    public static void main(String[] args) {
        int[][] directions = {{0, 1}, {0,-1}, {1, 0}, {-1, 0}};
    }

}

/**
 * Definition for singly-linked list.
 * public class ListNode {
 *     int val;
 *     ListNode next;
 *     ListNode() {}
 *     ListNode(int val) { this.val = val; }
 *     ListNode(int val, ListNode next) { this.val = val; this.next = next; }
 * }
 */
/*
class Solution {
    public ListNode removeNthFromEnd(ListNode head, int n) {
        ListNode dumyhead = new ListNode(-1);
        dumyhead.next = head;
        ListNode fast = dumyhead;
        ListNode slow = dumyhead;
        for(int i = 0;i<n;i++){
            fast = fast.next;
        }

        while(fast.next != null){
            fast = fast.next;
            slow = slow.next;
        }

        slow.next = slow.next.next;
        return dumyhead.next;

    }
}
*/
